<?php defined('SYSPATH') or die('No direct script access.');
 
class Model_Video extends ORM {
	protected $_table_name = 'video';

	public function getCategoryList($id, $offset) {
		$photos_per_page = Kohana::$config->load('main')->photos_per_page;

		return DB::select()
			->from($this->_table_name)
			->where('category_id', '=', $id)
			->and_where('display', '=', '1')
			->order_by(array('sort', 'id'), 'DESC')
			->limit($photos_per_page)
			->offset($offset)
			->as_object()
			->execute();
	}

}